import { Layers, Node, UITransform } from 'cc'

//设置一个创建的节点，把锚点位置放在左上角用位运算符来得到25具体得参考layer
export const createUINode = () => {
  const node = new Node()
  const transform = node.addComponent(UITransform)
  transform.setAnchorPoint(0, 1)
  node.layer = 1 << Layers.nameToLayer('UI_2D')
  return node
}

//创建一个随机数用来地图随机几个不一样的Tile
export const randomByRange = (start: number, end: number) => Math.floor(start + (end - start) * Math.random())
